<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.net.HttpURLConnection" %>
<%@ page import="java.net.URL" %>
<%@ page import="java.io.DataOutputStream" %>
<%@ page import="java.io.InputStreamReader" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.net.URLConnection" %>
<%@ page import="java.net.URLEncoder" %>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 

<%
try{
        String a="";
        String mobileNumber = "15618878281";
        a=a+"&mobileNumber="+mobileNumber;
        String bankCardNo = "6225882013911247";//借记卡
        a=a+"&bankCardNo="+bankCardNo;
        String accountNum = "14"+mobileNumber+"|"+bankCardNo;
        a=a+"&accountNum="+accountNum;
        String idCardType = "01";                   //银行开户证件类型，　01:身份证，02:护照，03:军人证，04:台胞证
         a=a+"&idCardType="+idCardType;
        String idCardNo = "440106196911211822";     //银行开户证件号
        a=a+"&idCardNo="+idCardNo;
        String idCardName = "董金凤";                 //银行开户姓名
//        a=a+"&idCardName="+idCardName;
        a=a+"&idCardName="+URLEncoder.encode(idCardName,"UTF-8");

        String userName = "董金凤";                   //订单商品受益人，多个受益人以","分割．
        a=a+"&userName="+URLEncoder.encode(userName,"UTF-8");
        String bankAddress = "上海";        //银行开户地，信用卡可填空，省市以","号分割．
        a=a+"&bankAddress="+URLEncoder.encode(bankAddress,"UTF-8");
        String ipAddress = "119.131.176.39";        //持卡人登录IP地址．
        a=a+"&ipAddress="+ipAddress;
        String idCardAddress = "";                  //身份证地址,截取至街道, 特殊风控.
        a=a+"&idCardAddress="+idCardAddress;
        String productPhoneNumber = "";             //受益手机号，电话充值商户需填写;
        a=a+"&productPhoneNumber="+productPhoneNumber;
        String productAddress = "";                 //商品销售地，省市以","号分割，团购商户需填写;
        a=a+"&productAddress="+productAddress;
        String bankPhoneNumber = "";
         a=a+"&bankPhoneNumber="+bankPhoneNumber;
        String extTransData = "appleID";                   //额外交易数据，　Apple appID
        a=a+"&extTransData="+extTransData;
        //订单信息，金额，描述，备注，订单号。
        String orderAmount = "1.99";
        a=a+"&orderAmount="+orderAmount;
        String orderDescription = "CAI HONGZHI";
        a=a+"&orderDescription="+orderDescription;
        String orderRemark = "";
         a=a+"&orderRemark="+orderRemark;
         
        String address="http://127.0.0.1:8080/HTPay/HTPayService";
        String returnxml="";
		URL url=new URL(address);
		HttpURLConnection conn=(HttpURLConnection)url.openConnection();
		conn.setRequestMethod("POST");
		conn.setUseCaches(false);
		conn.setInstanceFollowRedirects(true);
		conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
		conn.setConnectTimeout(60000);
		conn.setReadTimeout(60000);
		conn.setDoOutput(true);
		conn.connect();
		DataOutputStream out1=new DataOutputStream(conn.getOutputStream()); 
		out1.writeBytes(a); 
        out1.flush();
        out1.close();
        BufferedReader rd=new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8")); 
		returnxml=rd.readLine(); 
		rd.close();
        conn.disconnect();
        }catch(Exception e){
           e.printStackTrace();
        }
%>